import React from "react"
import { Route, Switch, Redirect, withRouter } from "react-router"
import { compose } from "redux"
import Loadable from "../utils/loadable"

// home
const Home = Loadable({
  loader: () => import("./pages/home"),
  loading: () => null,
})

// note
const Note = Loadable({
  loader: () => import("./pages/note"),
  loading: () => null,
})

const RouteList = () => {
  return (
    <Switch>
      <Route path="/home" component={Home} />
      <Route path="/note" component={Note} />
      <Redirect to="/home" />
    </Switch>
  )
}

export default compose(withRouter)(RouteList)
